<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script src="ajax.js"></script>
  <script>
    /*ajax("http://localhost/成亮")
    //return Promise
    .then(()=>ajax("http://localhost/燕儿"))
    //return Promise
    .then(()=>ajax("http://localhost/东东"))
    //return Promise
    .then(()=>console.log("比赛结束!"))
    .catch(errmsg=>{
      console.log(errmsg);
      console.log("比赛中断！");
    });*/

    Promise.all([
      ajax("http://localhost/成亮"),
      ajax("http://localhost/燕儿"),
      ajax("http://localhost/东东")
    ])
    .then(()=>console.log("比赛结束!"))
    .catch(errmsg=>{console.log("比赛中断!")})
  </script>
</body>
</html>